package Hibernate_web;


import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {

    private static final SessionFactory sessionfactory;

    static {
        Configuration configuration = new Configuration();
        configuration.configure();
        sessionfactory = configuration.
                buildSessionFactory(new StandardServiceRegistryBuilder().
                        applySettings(configuration.getProperties()).build());
    }

    public static SessionFactory getSessionfactory() {
        return sessionfactory;
    }

}

